package com.schoolMall.dao;

import com.schoolMall.domain.LocalAuth;
import org.apache.ibatis.annotations.Param;

import java.util.Date;

/**
 * @author:zyh
 * @Time:2021-09-03-15:50
 * @email:1269231889@qq.com
 */
public interface LocalAuthDao {

    /**
     * 登录用户
     * @param username
     * @param password
     * @return
     */
    LocalAuth queryLocalByUserNameAndPwd(@Param("username")String username,@Param("password")String password);

    /**
     * 查询用户
     * @param userId
     * @return
     */
    LocalAuth queryLocalByUserId(@Param("userId")long userId);

    /**
     * 注册
     * @param localAuth
     * @return
     */
    int insertLocalAuth(LocalAuth localAuth);

    /**
     * 更新用户信息
     * @param userId
     * @param username
     * @param password
     * @param newPassword
     * @param lastEditTime
     * @return
     */
    int updateLocalAuth(@Param("userId")Long userId, @Param("username")String username, @Param("password")String password
            , @Param("newPassword")String newPassword, @Param("lastEditTime")Date lastEditTime);
}
